package com.rainbow.bam.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 权限方法实体类
 * 
 * @author zhaolei
 * @version $Id: HtSrcAction.java, v 0.1 2015年11月19日 下午5:33:55 zhaolei Exp $
 */
@Entity
@Table(name = "ht_src_action")
@NamedQuery(name = "HtSrcAction.findAll", query = "SELECT c FROM HtSrcAction c")
public class HtSrcAction implements java.io.Serializable {

    /**
     *UUID
     */
    private static final long serialVersionUID = 3200145438216401849L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(generator = "identity")
    @GenericGenerator(name = "identity", strategy = "identity")
    @Column(unique = true, nullable = false, name = "action_id")
    private Long              id;
    /**
     * 方法名称
     */
    @Column(name = "action_name")
    private String            name;

    /**
     * 方法前缀标识（shiro授权）
     */
    @Column(name = "action_methods")
    private String  actionMethods;
    /**
     * 日志级别
     */
    @Column(name = "log_level")
    private Integer logLevel;
    /**
     * 方法名（;分割）
     */
    @Column(name = "method_name")
    private String  methodName;

    /**
     * 排序
     */
    @Column(name = "action_order")
    private Double actionOrder;

    /**
     * 关联菜单
     */
    @ManyToOne
    @JoinColumn(name = "source_id")
    private HtSource htSource;
    /**
     * 方法路径
     */
    @Column(name = "action_path")
    private String   actionPath;

    /**
     * 关联权限角色中间表
     */
    @OneToMany
    @JoinColumn(name = "action_id")
    private Set<HtDutyAction> htDutyActions;

    public HtSrcAction() {

    }

    public HtSource getHtSource() {
        return htSource;
    }

    public void setHtSource(HtSource htSource) {
        this.htSource = htSource;
    }

    public Set<HtDutyAction> getHtDutyActions() {
        return htDutyActions;
    }

    public void setHtDutyActions(Set<HtDutyAction> htDutyActions) {
        this.htDutyActions = htDutyActions;
    }

    public String getActionMethods() {
        return actionMethods;
    }

    public void setActionMethods(String actionPath) {
        this.actionMethods = actionPath;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String logClass) {
        this.methodName = logClass;
    }

    public Integer getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(Integer logLevel) {
        this.logLevel = logLevel;
    }

    public Double getActionOrder() {
        return actionOrder;
    }

    public void setActionOrder(Double actionOrder) {
        this.actionOrder = actionOrder;
    }

    public String getActionPath() {
        return actionPath;
    }

    public void setActionPath(String actionPath) {
        this.actionPath = actionPath;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
